package com.jianggy.facade;

/**
 * 外观类（门面类）
 * @author jianggy
 * @time 2018年9月20日 下午7:38:05
 * @description
 */
public class EncryptFacade {
	private CipherFile cipher;
	private FileWriter writer;
	private FileReader reader;

	/**
	 * @param cipher
	 * @param writer
	 * @param reader
	 */
	public EncryptFacade() {
		cipher = new CipherFile();
		reader = new FileReader();
		writer = new FileWriter();
	}

	public void fileEncrypt(String source, String des) {
		String content = reader.read(source);
		String res = cipher.encrypt(content);
		writer.write(des, res);
	}

}
